/*********************************************************************
* Created by Mercury Interactive Windows Sockets Recorder.
*
* Created on: Thu Jun 10 15:23:49
*********************************************************************/

#include "lrs.h"
//定义函数中使用的结构体
struct _trans_struct_new
{
	char optcode[5];
	char type[5];
	char agent_bankid[11];
	char bank_id[3];
	char date[9];
	char date_qs[9];
	char tele_id[13];
	char date_s[9];
	char date_e[9];
	char money[20];
	char l_money[20];
	char glide_no[11];
	char del_glideno[11];
	char node_num[16];
	char oper[5];
	char acc_ct[41];
	char acc_kh[41];
	char identity_code[128];
	char region_code[5];
	char check_content[31];
	char ext_one[128];
	char fname[31];
	char status[2];
	char errmsg[61];
};	

struct _trans_struct_new sendData;
struct _trans_struct_new recvData;

Action()
{
	char *optcode="CZ";
	char *type="TB";
	char *agent_bankid="";
	char *bank_id="90";
	char *date="20141215";
	char *date_qs="20141215";
	char *tele_id="18248460802";
	char *date_s="1";
	char *date_e="";
	char *money="30.00";
	char *l_money="";
	char *glide_no="10110015";
	char *del_glideno="";
	char *node_num="00231";
	char *oper="171";
	char *acc_ct="";
	char *acc_kh="13735893509";
	char *identity_code="";
	char *region_code="571";
	char *check_content="";
	char *ext_one="";
	char *fname="";
	char *status="";
	char *errmsg="";

	//调用需要的dll文件，dll文件在loadrunner安装的bin目录下
    lr_load_dll("HAIceDll.dll");

    //为结构体赋值
    sendData.optcode=optcode;
	sendData.type=type;
	sendData.agent_bankid=agent_bankid;
	sendData.bank_id=bank_id;
	sendData.date=date;
	sendData.date_qs=date_qs;
	sendData.tele_id=tele_id;
	sendData.date_s=date_s;
	sendData.date_e=date_e;
	sendData.money=money;
	sendData.l_money=l_money;
	sendData.glide_no=glide_no;
	sendData.del_glideno=del_glideno;
	sendData.node_num=node_num;
	sendData.oper=oper;
	sendData.acc_ct=acc_ct;
	sendData.acc_kh=acc_kh;
	sendData.identity_code=identity_code;
	sendData.region_code=region_code;
	sendData.check_content=check_content;
	sendData.ext_one=ext_one;
	sendData.fname=fname;
	sendData.status=status;
	sendData.errmsg=errmsg;


    //插入开始事务
    lr_start_transaction("CZ");
    //调用函数

    HMSACLientSendMsg(&sendData,&recvData,"192.168.1.186","8000");
    lr_message("函数的返回值是：%s",recvData.status);


 

  //结束事务标志
    lr_end_transaction("CZ", LR_AUTO);
  

//清空占用的内存
HMSAClientClean(&a,&b);

//定义休息时间，单位：毫秒，即：1s=1000ms
//sleep(2000);

    return 0;
}